package user

import (
	"APi/client"
	"APi/response"
	"github.com/gin-gonic/gin"
	user "user_srv/proto"
)

func OrderList(c *gin.Context) {
	userid := c.GetUint("userId")
	list, err := client.OrderList(c, &user.OrderListRequest{UserId: int64(userid)})
	if err != nil {
		response.CurrencyErrResponse(c, -1, err.Error())
		return
	}
	response.CurrencySuccessResponse(c, "订单查询成功", map[string]interface{}{"order_list": list.AllOrder})
}
